package cmd

import (
	"cli/nets"
	"flag"
	"fmt"
	"os"
)

func TestCmd() {
	test := flag.NewFlagSet("test", flag.ExitOnError)
	var flash bool
	var night bool
	var storage bool
	var getStorage bool
	var print bool
	test.BoolVar(&flash, "flash", false, "刷新内存")
	test.BoolVar(&night, "night", false, "模拟夜晚刷新内存")
	test.BoolVar(&storage, "storage", false, "持久化内存")
	test.BoolVar(&getStorage, "getStorage", false, "获取持久化内存")
	test.BoolVar(&print, "print", false, "打印持久化内存")
	test.Parse(os.Args[2:])
	if flash {
		fmt.Println("刷新一次")
		nets.Flash()
	}
	if night {
		nets.Night()
	}
	if storage {
		nets.Storage()
	}
	if getStorage {
		nets.GetStorage()
	}
	if print {
		nets.Print()
	}
	return

}
